/**
 * 登录组件
 */
import React, { Component } from 'react'

export default class Login extends Component {
  login = () => {
    console.log(this.props.history)
    const { push, go, replace } = this.props.history
    localStorage.setItem('token', Math.random() * 1000)
    // push('/')
    // go(-1)
    replace('/home')
  }

  render() {
    return (
      <div>
        <button onClick={this.login}>登录</button>
      </div>
    )
  }
}
